package com.freedom.admin.infrastructure.persistence.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.freedom.admin.infrastructure.persistence.pojo.bo.UserAuthBO;
import com.freedom.admin.infrastructure.persistence.pojo.bo.UserBO;
import com.freedom.admin.infrastructure.persistence.pojo.bo.UserExportBO;
import com.freedom.admin.infrastructure.persistence.pojo.bo.UserFormBO;
import com.freedom.admin.infrastructure.persistence.pojo.po.SysUserPO;
import com.freedom.admin.infrastructure.persistence.pojo.query.UserPageQuery;
import com.freedom.common.db.annotation.DataPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUserPO> {

    /**
     * 获取用户分页列表
     *
     * @param page
     * @param queryParams 查询参数
     * @return
     */
    @DataPermission(deptAlias = "d")
    Page<UserBO> listUserPages(Page<UserBO> page, @Param("queryParams") UserPageQuery queryParams);

    /**
     * 获取用户表单详情
     *
     * @param userId 用户ID
     * @return
     */
    UserFormBO getUserFormData(Integer userId);

    /**
     * 根据用户名获取认证信息
     *
     * @param username
     * @return
     */
    UserAuthBO getAuthInfoByUsername(String username);

    /**
     * 获取导出用户列表
     *
     * @param queryParams
     * @return
     */
    @DataPermission(deptAlias = "d")
    List<UserExportBO> listExportUsers(UserPageQuery queryParams);

    void deleteByIds(List<Integer> ids);
}
